package Java多线程和并发.Java并发理论基础;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2022-02-17 17:12
 **/
public class TestUnmodifiable {
    public static void main(String[] args) {
        Map<String, Object> map = new HashMap<>(8);
        map.put("a", 1);
        map.put("c", 4);
        Map<String, Object> unmodifiableMap = Collections.unmodifiableMap(map);
        unmodifiableMap.put("d", 2);
    }
}
